package kr.hkit.androidcomplete01.ch07;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Bundle;
import android.view.View;

public class Primitive extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		MyView mv = new MyView(this);
		setContentView(mv);
	}
	
	class MyView extends View{
		Paint pnt = new Paint();
		
		public MyView(Context context) {
			super(context);
		}
		
		public void onDraw(Canvas canvas){
			canvas.drawColor(Color.LTGRAY);
			canvas.drawPoint(10, 10, pnt);
			pnt.setColor(Color.BLUE);
			canvas.drawLine(20, 10, 200, 50, pnt);
			pnt.setColor(Color.RED);
			canvas.drawCircle(100, 90, 50, pnt);
			pnt.setColor(0x800000ff);
			canvas.drawRect(10, 100, 200, 170, pnt);
			pnt.setColor(Color.BLACK);
			canvas.drawText("Canvas Text Out", 10, 200, pnt);
			pnt.setColor(0x80ff0000);
		}
	}
}
